package com.jubaozan.c3.user.controller;

import com.jubaozan.c3.user.dao.domain.User;
import com.jubaozan.c3.user.dao.service.UserService;
import org.springframework.web.bind.annotation.*;

/**
 * @author yuanjie
 */
@RestController
@RequestMapping("/user")
public class UserController {

    private final UserService userService;

    public UserController(final UserService userService) {
        this.userService = userService;
    }

    @GetMapping("/{id}")
    public User getUserById(@PathVariable("id") Long id) {
        return userService.getById(id);
    }
}
